<!--Shows 2 newsfeed items for  each team-->
<%j=0%>
<% if @feeds %>
<div style='display:block; padding:5px 10px 10px 10px; overflow:auto; text-align:center; '>
	<% @team.each do |item| %>
	
				<% @teamdata = Team.find_by_id(item) %>
				
				<div onclick="change_team_<%=@sid%>(<%=j%>)"  class='team_item' id="<%='title_'+(@team[j]+@sid).to_s%>"
					<%if j==0%>  
						style="border:2px solid #3B5888"
					<%end%>>	
					<span><%=@teamdata.display_name ? @teamdata.display_name: @teamdata.name%></span>
				</div>
	<%j+=1%>	
	<%end%>
</div>	
<%i=0%>

	<% @feeds.each do |item| %>
	
		<div id="<%=@team[i]+@sid%>" <%="style='display:none'" if i==1%>>
			
			<%if item %>
				<%item.each do |value|%>
					<% value.description.gsub!('8em', '0em') if value.description %>
					<h2 style='padding-left:5px; padding-top:10px'><%=link_to value.title, value.link, {:class=>'feedtitle', :target=>'_blank'}%></h2> 
						<% unless value.description.index("&lt;img")%>
							<% value.description.gsub!('<td width="80" align="center" valign="top"><font style="font-size:85%;font-family:arial,sans-serif"></font></td><td', '<td colspan="2" ') if value.description %>
							
						<% end %>
						<%=value.description if value.description%>
					<% @send_id = value.id %>
					
				<%end%>
			  
			<%end%>
		
			<div style='display:block; overflow:auto'>	
					<div class="next_section"><span  onclick="ajax_request(Ajax.FBML,'<%=@call_back_url%>', '<%=@team[i]+@sid%>', 'newsfeeds', 'get_pare_feeds', <%=@send_id%>, 'next', <%=@sid%>); return false;">Next</span></div>
			</div>

		 </div>	 
		<%i=i+1%>	
	<%end%>	
<% end %>

<script>
		
		function change_team_<%=@sid%>(number){
		
		if (number == 0) {
		
			$("<%=@team[0]+@sid%>").setStyle('display', 'block');
			document.getElementById("title_<%=(@team[0]+@sid).to_s%>").setStyle('border', '2px solid #3B5888');
			$("<%=@team[1]+@sid%>").setStyle('display', 'none');
			document.getElementById("title_<%=(@team[1]+@sid).to_s%>").setStyle('border', '2px solid #E3DEDE');
		}
		
		else {
			
			$("<%=@team[1]+@sid%>").setStyle('display', 'block');
		document.getElementById("title_<%=(@team[1]+@sid).to_s%>").setStyle('border', '2px solid #3B5888');
			$("<%=@team[0]+@sid%>").setStyle('display', 'none');
			document.getElementById("title_<%=(@team[0]+@sid).to_s%>").setStyle('border', '2px solid #E3DEDE');
		}
			
		}
</script>
